package it.etoken.component.user.dao.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

import it.etoken.base.model.user.entity.EosAccountOrder;
import it.etoken.base.model.user.entity.EosAccountOrderExample;

@Mapper
public interface EosAccountOrderMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table eos_account_order
     *
     * @mbg.generated Mon Jul 09 16:58:56 CST 2018
     */
    @SelectProvider(type=EosAccountOrderSqlProvider.class, method="countByExample")
    long countByExample(EosAccountOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table eos_account_order
     *
     * @mbg.generated Mon Jul 09 16:58:56 CST 2018
     */
    @DeleteProvider(type=EosAccountOrderSqlProvider.class, method="deleteByExample")
    int deleteByExample(EosAccountOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table eos_account_order
     *
     * @mbg.generated Mon Jul 09 16:58:56 CST 2018
     */
    @Delete({
        "delete from eos_account_order",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table eos_account_order
     *
     * @mbg.generated Mon Jul 09 16:58:56 CST 2018
     */
    @Insert({
        "insert into eos_account_order (id, order_no, ",
        "status, uid, username, ",
        "amount, ram, cpu, ",
        "net, account_name, ",
        "public_key, createdate, ",
        "updatedate)",
        "values (#{id,jdbcType=BIGINT}, #{orderNo,jdbcType=VARCHAR}, ",
        "#{status,jdbcType=VARCHAR}, #{uid,jdbcType=BIGINT}, #{username,jdbcType=VARCHAR}, ",
        "#{amount,jdbcType=DECIMAL}, #{ram,jdbcType=BIGINT}, #{cpu,jdbcType=BIGINT}, ",
        "#{net,jdbcType=BIGINT}, #{accountName,jdbcType=VARCHAR}, ",
        "#{publicKey,jdbcType=VARCHAR}, #{createdate,jdbcType=TIMESTAMP}, ",
        "#{updatedate,jdbcType=TIMESTAMP})"
    })
    int insert(EosAccountOrder record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table eos_account_order
     *
     * @mbg.generated Mon Jul 09 16:58:56 CST 2018
     */
    @InsertProvider(type=EosAccountOrderSqlProvider.class, method="insertSelective")
    int insertSelective(EosAccountOrder record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table eos_account_order
     *
     * @mbg.generated Mon Jul 09 16:58:56 CST 2018
     */
    @SelectProvider(type=EosAccountOrderSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.VARCHAR),
        @Result(column="uid", property="uid", jdbcType=JdbcType.BIGINT),
        @Result(column="username", property="username", jdbcType=JdbcType.VARCHAR),
        @Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL),
        @Result(column="ram", property="ram", jdbcType=JdbcType.BIGINT),
        @Result(column="cpu", property="cpu", jdbcType=JdbcType.BIGINT),
        @Result(column="net", property="net", jdbcType=JdbcType.BIGINT),
        @Result(column="account_name", property="accountName", jdbcType=JdbcType.VARCHAR),
        @Result(column="public_key", property="publicKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="createdate", property="createdate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="updatedate", property="updatedate", jdbcType=JdbcType.TIMESTAMP)
    })
    List<EosAccountOrder> selectByExample(EosAccountOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table eos_account_order
     *
     * @mbg.generated Mon Jul 09 16:58:56 CST 2018
     */
    @Select({
        "select",
        "id, order_no, status, uid, username, amount, ram, cpu, net, account_name, public_key, ",
        "createdate, updatedate",
        "from eos_account_order",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.VARCHAR),
        @Result(column="uid", property="uid", jdbcType=JdbcType.BIGINT),
        @Result(column="username", property="username", jdbcType=JdbcType.VARCHAR),
        @Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL),
        @Result(column="ram", property="ram", jdbcType=JdbcType.BIGINT),
        @Result(column="cpu", property="cpu", jdbcType=JdbcType.BIGINT),
        @Result(column="net", property="net", jdbcType=JdbcType.BIGINT),
        @Result(column="account_name", property="accountName", jdbcType=JdbcType.VARCHAR),
        @Result(column="public_key", property="publicKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="createdate", property="createdate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="updatedate", property="updatedate", jdbcType=JdbcType.TIMESTAMP)
    })
    EosAccountOrder selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table eos_account_order
     *
     * @mbg.generated Mon Jul 09 16:58:56 CST 2018
     */
    @UpdateProvider(type=EosAccountOrderSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") EosAccountOrder record, @Param("example") EosAccountOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table eos_account_order
     *
     * @mbg.generated Mon Jul 09 16:58:56 CST 2018
     */
    @UpdateProvider(type=EosAccountOrderSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") EosAccountOrder record, @Param("example") EosAccountOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table eos_account_order
     *
     * @mbg.generated Mon Jul 09 16:58:56 CST 2018
     */
    @UpdateProvider(type=EosAccountOrderSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(EosAccountOrder record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table eos_account_order
     *
     * @mbg.generated Mon Jul 09 16:58:56 CST 2018
     */
    @Update({
        "update eos_account_order",
        "set order_no = #{orderNo,jdbcType=VARCHAR},",
          "status = #{status,jdbcType=VARCHAR},",
          "uid = #{uid,jdbcType=BIGINT},",
          "username = #{username,jdbcType=VARCHAR},",
          "amount = #{amount,jdbcType=DECIMAL},",
          "ram = #{ram,jdbcType=BIGINT},",
          "cpu = #{cpu,jdbcType=BIGINT},",
          "net = #{net,jdbcType=BIGINT},",
          "account_name = #{accountName,jdbcType=VARCHAR},",
          "public_key = #{publicKey,jdbcType=VARCHAR},",
          "createdate = #{createdate,jdbcType=TIMESTAMP},",
          "updatedate = #{updatedate,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(EosAccountOrder record);
}